package sistemacontrol;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
import org.jvnet.substance.SubstanceLookAndFeel;

public class BuscarFrame extends javax.swing.JFrame 
{
    public BuscarControl control;
    static Connection cn;
    static Statement s;
    static ResultSet rs;

    /** Creates new form BuscarFrame */
    public BuscarFrame() {
        initComponents();
        JFrame.setDefaultLookAndFeelDecorated(true);
          SubstanceLookAndFeel.setSkin("org.jvnet.substance.SubstanceSaharaLookAndFeel");
        this.setLocationRelativeTo(null);
        this.setTitle("BUSCAR");
        
       //this.ApellidosjTextField.setVisible(false);
        jPanel4.setVisible(false);
        jPanel2.setVisible(false);
        jPanel3.setVisible(false);
        jPanel5.setVisible(false);
        EstadojPanel.setVisible(false);
        ParametrosjPanel.setVisible(false);
        this.control = new BuscarControl(this);
        this.control.CargarCombo();
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")

    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        GrupoParametros = new javax.swing.ButtonGroup();
        GrupoEstado = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        ParametrosjPanel = new javax.swing.JPanel();
        apellidojRadioButton = new javax.swing.JRadioButton();
        cijRadioButton = new javax.swing.JRadioButton();
        EstadojRadioButton = new javax.swing.JRadioButton();
        FechasjRadioButton = new javax.swing.JRadioButton();
        RangojRadioButton = new javax.swing.JRadioButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        ModulosjList1 = new javax.swing.JList();
        jPanel4 = new javax.swing.JPanel();
        ApellidosjTextField = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        cijTextField = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        ProgramaComboBox = new javax.swing.JComboBox();
        EstadojPanel = new javax.swing.JPanel();
        ActivojCheckBox = new javax.swing.JCheckBox();
        ProcesojCheckBox = new javax.swing.JCheckBox();
        ConcluidojCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox4 = new javax.swing.JCheckBox();
        jCheckBox5 = new javax.swing.JCheckBox();
        jPanel5 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        Fecha2jFormattedTextField = new javax.swing.JFormattedTextField();
        jLabel5 = new javax.swing.JLabel();
        Fecha1jFormattedTextField = new javax.swing.JFormattedTextField();
        OkButton = new javax.swing.JButton();
        ModificarjButton = new javax.swing.JButton();
        EliminarjButton = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        NuevojButton = new javax.swing.JButton();
        SalirjButton = new javax.swing.JButton();
        BuscarjButton = new javax.swing.JButton();
        LimpiarjButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel1.setEnabled(false);

        ParametrosjPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Parametros"));

        GrupoParametros.add(apellidojRadioButton);
        apellidojRadioButton.setText("Apellidos");
        apellidojRadioButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                apellidojRadioButtonActionPerformed(evt);
            }
        });

        GrupoParametros.add(cijRadioButton);
        cijRadioButton.setText("C.I.");

        GrupoParametros.add(EstadojRadioButton);
        EstadojRadioButton.setText("Estado");
        EstadojRadioButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EstadojRadioButtonActionPerformed(evt);
            }
        });

        GrupoParametros.add(FechasjRadioButton);
        FechasjRadioButton.setText("Fechas");

        GrupoParametros.add(RangojRadioButton);
        RangojRadioButton.setText("Programa");

        javax.swing.GroupLayout ParametrosjPanelLayout = new javax.swing.GroupLayout(ParametrosjPanel);
        ParametrosjPanel.setLayout(ParametrosjPanelLayout);
        ParametrosjPanelLayout.setHorizontalGroup(
            ParametrosjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ParametrosjPanelLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(ParametrosjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(EstadojRadioButton)
                    .addComponent(FechasjRadioButton)
                    .addComponent(apellidojRadioButton)
                    .addComponent(RangojRadioButton)
                    .addComponent(cijRadioButton))
                .addContainerGap(46, Short.MAX_VALUE))
        );
        ParametrosjPanelLayout.setVerticalGroup(
            ParametrosjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ParametrosjPanelLayout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(apellidojRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cijRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RangojRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(FechasjRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(EstadojRadioButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Modulos"));

        ModulosjList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Ot", "Persona", "Movimiento" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(ModulosjList1);

        ApellidosjTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ApellidosjTextFieldActionPerformed(evt);
            }
        });
        ApellidosjTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                ApellidosjTextFieldKeyReleased(evt);
            }
        });

        jLabel1.setText("Apalliedos :");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ApellidosjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(23, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(ApellidosjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel2.setText("C.I. :");

        cijTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cijTextFieldActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cijTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(47, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(cijTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(4, Short.MAX_VALUE))
        );

        jLabel3.setText("Programa :");

        ProgramaComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ProgramaComboBoxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ProgramaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(56, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(ProgramaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        EstadojPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Estado"));

        GrupoEstado.add(ActivojCheckBox);
        ActivojCheckBox.setText("Activo");

        GrupoEstado.add(ProcesojCheckBox);
        ProcesojCheckBox.setText("Proceso");

        GrupoEstado.add(ConcluidojCheckBox3);
        ConcluidojCheckBox3.setText("Concluido");

        GrupoEstado.add(jCheckBox4);
        jCheckBox4.setText("jCheckBox1");

        GrupoEstado.add(jCheckBox5);
        jCheckBox5.setText("jCheckBox1");

        javax.swing.GroupLayout EstadojPanelLayout = new javax.swing.GroupLayout(EstadojPanel);
        EstadojPanel.setLayout(EstadojPanelLayout);
        EstadojPanelLayout.setHorizontalGroup(
            EstadojPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(EstadojPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(EstadojPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(EstadojPanelLayout.createSequentialGroup()
                        .addComponent(ActivojCheckBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                        .addComponent(jCheckBox4))
                    .addGroup(EstadojPanelLayout.createSequentialGroup()
                        .addComponent(ProcesojCheckBox)
                        .addGap(12, 12, 12)
                        .addComponent(jCheckBox5))
                    .addComponent(ConcluidojCheckBox3))
                .addContainerGap())
        );
        EstadojPanelLayout.setVerticalGroup(
            EstadojPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(EstadojPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(EstadojPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ActivojCheckBox)
                    .addComponent(jCheckBox4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(EstadojPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCheckBox5)
                    .addComponent(ProcesojCheckBox))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(ConcluidojCheckBox3)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        jLabel4.setText("Fechas :");

        Fecha2jFormattedTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Fecha2jFormattedTextFieldActionPerformed(evt);
            }
        });

        jLabel5.setText("entre");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Fecha1jFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(2, 2, 2)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Fecha2jFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Fecha1jFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Fecha2jFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4))
                .addContainerGap())
        );

        OkButton.setIcon(new javax.swing.ImageIcon("D:\\vhstyle\\sistemavh\\site_media\\img\\ok1.png")); // NOI18N
        OkButton.setText("OK");
        OkButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OkButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ParametrosjPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(28, 28, 28)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(6, 6, 6)
                        .addComponent(EstadojPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(OkButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(1, 1, 1)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(EstadojPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(ParametrosjPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                .addComponent(OkButton))
        );

        ModificarjButton.setIcon(new javax.swing.ImageIcon("D:\\vhstyle\\sistemavh\\site_media\\img\\edit.png")); // NOI18N
        ModificarjButton.setText("Modificar");
        ModificarjButton.setName(""); // NOI18N
        ModificarjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ModificarjButtonActionPerformed(evt);
            }
        });

        EliminarjButton.setIcon(new javax.swing.ImageIcon("D:\\Systema vh2\\SISTEMA VHSTYLE\\Imagen\\Eliminar2.png")); // NOI18N
        EliminarjButton.setText("Eliminar");
        EliminarjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EliminarjButtonActionPerformed(evt);
            }
        });

        jScrollPane2.setViewportView(jTable1);

        NuevojButton.setIcon(new javax.swing.ImageIcon("D:\\vhstyle\\sistemavh\\site_media\\img\\add.png")); // NOI18N
        NuevojButton.setText("Nuevo");
        NuevojButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NuevojButtonActionPerformed(evt);
            }
        });

        SalirjButton.setIcon(new javax.swing.ImageIcon("D:\\vhstyle\\sistemavh\\site_media\\img\\delete.png")); // NOI18N
        SalirjButton.setText("Salir");

        BuscarjButton.setIcon(new javax.swing.ImageIcon("D:\\Systema vh2\\SISTEMA VHSTYLE\\Imagen\\buscar.png")); // NOI18N
        BuscarjButton.setText("Buscar");
        BuscarjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BuscarjButtonActionPerformed(evt);
            }
        });

        LimpiarjButton.setIcon(new javax.swing.ImageIcon("C:\\Users\\edson23\\Pictures\\Limpiar.png")); // NOI18N
        LimpiarjButton.setText("Limpiar");
        LimpiarjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LimpiarjButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 695, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(NuevojButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(ModificarjButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(EliminarjButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(SalirjButton))
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 651, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(BuscarjButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(LimpiarjButton)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BuscarjButton)
                    .addComponent(LimpiarjButton))
                .addGap(29, 29, 29)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
                .addGap(121, 121, 121)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EliminarjButton)
                    .addComponent(ModificarjButton)
                    .addComponent(SalirjButton)
                    .addComponent(NuevojButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void cijTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cijTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cijTextFieldActionPerformed

private void ProgramaComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ProgramaComboBoxActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_ProgramaComboBoxActionPerformed

private void Fecha2jFormattedTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Fecha2jFormattedTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_Fecha2jFormattedTextFieldActionPerformed

private void apellidojRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_apellidojRadioButtonActionPerformed
// TODO add your handling code here:
    
}//GEN-LAST:event_apellidojRadioButtonActionPerformed

private void ApellidosjTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ApellidosjTextFieldActionPerformed
// TODO add your handling code here:
   
}//GEN-LAST:event_ApellidosjTextFieldActionPerformed

private void EstadojRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EstadojRadioButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_EstadojRadioButtonActionPerformed

private void BuscarjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BuscarjButtonActionPerformed
    
}//GEN-LAST:event_BuscarjButtonActionPerformed

private void OkButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OkButtonActionPerformed
 this.control.BuscarjButtonActionPerformed();
  //TODO add your handling code here:
}//GEN-LAST:event_OkButtonActionPerformed

private void NuevojButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NuevojButtonActionPerformed
// TODO add your handling code here:
     if (this.ModulosjList1.getSelectedIndex()==-1) {
        JOptionPane.showMessageDialog(null, "Tienes que seleccionar un MODULO de la LISTA !!!");
     }
}//GEN-LAST:event_NuevojButtonActionPerformed

private void ModificarjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModificarjButtonActionPerformed
// TODO add your handling code here:
     if (this.ModulosjList1.getSelectedIndex()==-1) {
        JOptionPane.showMessageDialog(null, "Tienes que seleccionar un MODULO de la LISTA !!!");
     }
}//GEN-LAST:event_ModificarjButtonActionPerformed

private void EliminarjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EliminarjButtonActionPerformed
// TODO add your handling code here:
     if (this.ModulosjList1.getSelectedIndex()==-1) {
        JOptionPane.showMessageDialog(null, "Tienes que seleccionar un MODULO de la LISTA !!!");
     }
}//GEN-LAST:event_EliminarjButtonActionPerformed

private void LimpiarjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LimpiarjButtonActionPerformed
// TODO add your handling code here://////
    this.jPanel2.setVisible(false);
     this.jPanel3.setVisible(false);
      this.jPanel4.setVisible(false);
       this.jPanel5.setVisible(false);
       this.EstadojPanel.setVisible(false);
       this.ParametrosjPanel.setVisible(false);
       
}//GEN-LAST:event_LimpiarjButtonActionPerformed

private void ApellidosjTextFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_ApellidosjTextFieldKeyReleased
// TODO add your handling code here:*******************************
    
//         Connection cn;
//           if(ApellidosjTextField.getText().isEmpty()){
//              modelo.clear();
//           }
//           else{
//               try {
//                       //Para establecer el modelo al JTable
//                      DefaultTableModel modelo = new DefaultTableModel();
//                     this.jTable1.setModel(modelo);
//
//                   Class.forName("org.postgresql.Driver");
//                   String url = "jdbc:postgresql://localhost:5432/Gym";
//                   cn = DriverManager.getConnection(url, "postgres", "123");
//                   String cad=this.ApellidosjTextField.getText();
//                   PreparedStatement ps=cn.prepareStatement("select apellido||''||nombre from persona where apellido like'"
//                           +cad+"%'");
//               ResultSet  rs=ps.executeQuery();
//              
//               while(rs.next()){
//                modelo.addColumn(rs.getObject(1));  
//               }
//                 this.jTable1.setModel(modelo);     
//               }
//               catch(ClassNotFoundException e){
//                   JOptionPane.showMessageDialog(rootPane, e.getMessage());
//               }
//               
//           }
          
}//GEN-LAST:event_ApellidosjTextFieldKeyReleased

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(BuscarFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(BuscarFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(BuscarFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(BuscarFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new BuscarFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JCheckBox ActivojCheckBox;
    public javax.swing.JTextField ApellidosjTextField;
    private javax.swing.JButton BuscarjButton;
    public javax.swing.JCheckBox ConcluidojCheckBox3;
    private javax.swing.JButton EliminarjButton;
    public javax.swing.JPanel EstadojPanel;
    public javax.swing.JRadioButton EstadojRadioButton;
    public javax.swing.JFormattedTextField Fecha1jFormattedTextField;
    public javax.swing.JFormattedTextField Fecha2jFormattedTextField;
    public javax.swing.JRadioButton FechasjRadioButton;
    private javax.swing.ButtonGroup GrupoEstado;
    private javax.swing.ButtonGroup GrupoParametros;
    private javax.swing.JButton LimpiarjButton;
    private javax.swing.JButton ModificarjButton;
    public javax.swing.JList ModulosjList1;
    private javax.swing.JButton NuevojButton;
    private javax.swing.JButton OkButton;
    public javax.swing.JPanel ParametrosjPanel;
    public javax.swing.JCheckBox ProcesojCheckBox;
    public javax.swing.JComboBox ProgramaComboBox;
    public javax.swing.JRadioButton RangojRadioButton;
    private javax.swing.JButton SalirjButton;
    public javax.swing.JRadioButton apellidojRadioButton;
    public javax.swing.JRadioButton cijRadioButton;
    public javax.swing.JTextField cijTextField;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    public javax.swing.JPanel jPanel1;
    public javax.swing.JPanel jPanel2;
    public javax.swing.JPanel jPanel3;
    public javax.swing.JPanel jPanel4;
    public javax.swing.JPanel jPanel5;
    public javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    public javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
}
